package com.situ.mall.controller.back;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.situ.mall.common.ServerResponse;
import com.situ.mall.entity.Order;
import com.situ.mall.service.IOrderService;

@Controller
@RequestMapping("/order")
public class OrderController {
	
	@Autowired
	private IOrderService orderService;
	
	//跳转到order_list 界面
	@RequestMapping("/getOrderPage")
	public String getOrderPage() {
		
		return "/order/order_list";
	}
	//数据接口
	@RequestMapping("/List")
	public List<Order> List() {
		
		return orderService.list();
	}
	
	//pageList
	@RequestMapping("/pageList")
	@ResponseBody
	public ServerResponse pageList(Integer page,Integer limit) {
		ServerResponse serverResponse = orderService.pageList(page, limit);
		return serverResponse;
	}
	//删除
	@RequestMapping("/deleteById")
	@ResponseBody
	public ServerResponse deleteById(Integer id) {
		return orderService.deleteById(id);
	}
	
}
